settings: Provide a default style cascade per scale
authorBenjamin Otte <otte@redhat.com>
Fri, 6 Feb 2015 09:13:11 +0000 (10:13 +0100)
committerBenjamin Otte <otte@redhat.com>
Fri, 6 Feb 2015 10:26:31 +0000 (11:26 +0100)
commit808bfe0a98ac4cd2e11ea4eed82a66470121c19b
treeb797131884364ce9defb544b7fc195532e97ec58
parent9209c4ea411efc08a59eba12ff7898bd7be1aa05
settings: Provide a default style cascade per scale

This guarantees we only create 1 extra style cascade in total for hidpi
and not one per style context.

Style cascades are now nested like this:

GtkSettings root cascade (scale == 1)
 |
 +-- GtkSettings per scale cascade (for any scale, no custom providers)
 |
 +-- GtkStyleContext custom cascade (for any scale, custom providers)

This requires a bunch of care when changing cascade-related properties
inside GtkStyleContext, so that it ends up with a properly setup
cascade, but I think I got those cases right.

The only thing we don't do yet is reverting to a GtkSettings cascade
when the last custom provider is removed from a custom cascade.
gtk/gtksettings.c
gtk/gtksettingsprivate.h
gtk/gtkstylecontext.c